<?php

class Loader  
{
    public function __construct()
    {
    	function __autoload($class_name) {
    		
    		$class_name_explode = explode("_", $class_name);
    		
    		if ('Vophper' == $class_name_explode[0])
    		{
    			$dir = LIBRARY . str_replace("_", DS, $class_name);	    		
    		}
    		else 
    		{
    			$class_name = str_replace("Application_", "", $class_name);
    			$dir = str_replace("_", DS, $class_name);	
    		}
    		
    		require_once $dir . '.php';
		}
    }
}

$loader = new Loader();
